package com.dayuanit.dy17.spring.entity;

public class Person {
    private String username;
    private Integer age;
    private Dog dog;

    public Person() {
        System.out.println("---------Person()----------");
    }

    public void speak() {
        System.out.println(username + " 年龄是" + age + " 狗的名字:" + dog.getName());
    }

    @Override
    public String toString() {
        return "Person{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }

    public Dog getDog() {
        return dog;
    }
}
